C++: Prevent an Expr from stepping to itself in IR dataflow#11640
Merged
MathiasVP merged 2 commits intogithub:mathiasvp/replace-ast-with-ir-use-usedataflowfrom Dec 9, 2022
Conversation
jketema
approved these changes
Dec 9, 2022
Contributor
jketema
left a comment
There was a problem hiding this comment.
LGTM assuming DCA is happy.
Contributor
Author
|
DCA looks fine 🎉 |
2ad61df
into
github:mathiasvp/replace-ast-with-ir-use-usedataflow
Contributor
|
More than fine 😄 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While investigating some query changes, I noticed that it can be the case that a single local step can step from a node
n1representing the an expression, to a noden2that represents the expression's first conversion. Becausen.asExprthen resolves to the unconverted expression, the result will be an expressionesuch thatlocalExprFlowStep(e, e)holds 😱.The fix is to add another level of recursion that ensures that we always step to a different expression. This is done in a328565. 52bf39b fixes a performance shown by the join-order detection in DCA. It turns out the
*in thelocalExprFlowrelation wasn't turned into afastTCby the compiler, and it resulted in quite a few iterations that looked like:So the last commit transforms that
*into afastTCmanually.